# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V4.Model.DeliverySchedule do
  @moduledoc """
  Delivery Schedule.

  ## Attributes

  *   `frequencyCap` (*type:* `GoogleApi.DFAReporting.V4.Model.FrequencyCap.t`, *default:* `nil`) - Limit on the number of times an individual user can be served the ad within a specified period of time.
  *   `hardCutoff` (*type:* `boolean()`, *default:* `nil`) - Whether or not hard cutoff is enabled. If true, the ad will not serve after the end date and time. Otherwise the ad will continue to be served until it has reached its delivery goals.
  *   `impressionRatio` (*type:* `String.t`, *default:* `nil`) - Impression ratio for this ad. This ratio determines how often each ad is served relative to the others. For example, if ad A has an impression ratio of 1 and ad B has an impression ratio of 3, then Campaign Manager will serve ad B three times as often as ad A. Acceptable values are 1 to 10, inclusive.
  *   `priority` (*type:* `String.t`, *default:* `nil`) - Serving priority of an ad, with respect to other ads. The lower the priority number, the greater the priority with which it is served.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :frequencyCap => GoogleApi.DFAReporting.V4.Model.FrequencyCap.t() | nil,
          :hardCutoff => boolean() | nil,
          :impressionRatio => String.t() | nil,
          :priority => String.t() | nil
        }

  field(:frequencyCap, as: GoogleApi.DFAReporting.V4.Model.FrequencyCap)
  field(:hardCutoff)
  field(:impressionRatio)
  field(:priority)
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V4.Model.DeliverySchedule do
  def decode(value, options) do
    GoogleApi.DFAReporting.V4.Model.DeliverySchedule.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V4.Model.DeliverySchedule do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
